package com.flame.shapeville.component.task1.shape2D;

import javafx.scene.paint.Color;
import javafx.scene.shape.Polygon;

/**
 * Represents a rhombus used in Task 1.
 * <p>
 * This class draws a four-point diamond shape with equal side lengths.
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-12
 */
public class JfRhombus extends JfShape2D {

    /**
     * Constructs a new rhombus with the specified size.
     *
     * @param size the bounding box size for the rhombus
     */
    public JfRhombus(double size) {
        this.size = size;
        shape = new Polygon(
                size / 2, 0,
                size / 2 - size / 2 / Math.sqrt(3), size / 2,
                size / 2, size,
                size / 2 + size / 2 / Math.sqrt(3), size / 2
        );
        initBaseParams(Color.CYAN);
    }
}
